<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><script type="text/javascript" src="https://cdn.jsdelivr.net/gh/opencobra/cobratoolbox@ffa0229fc0c01c9236bb7e961f65712443277719/latest/_static/js/iframeResizer.contentWindow.min.js"></script><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB 2021a"><title>SAMMI Interactive Network Visualization Tool</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: normal; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: normal; text-align: left;  }
.S1 { margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S2 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S3 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S4 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: normal;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S5 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S6 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>SAMMI Interactive Network Visualization Tool</span></h1><h2  class = 'S1'><span>Authors:</span></h2><div  class = 'S2'><span>Andre Schultz, Department of Bioinformatics and Computational Biology, UT MD Anderson Cancer Center, Houston, Texas, USA</span></div><div  class = 'S2'><span>Rehan Akbani, Department of Bioinformatics and Computational Biology, UT MD Anderson Cancer Center, Houston, Texas, USA</span></div><h2  class = 'S1'><span>INTRODUCTION</span></h2><div  class = 'S2'><span>SAMMI loads COBRA models as force-directed, interactive networks on a web-browser. Large networks can easily be partitioned into sub-networks which can then be navigated using a series of provided functionality. Users can also load only a subset of reactions and map data as nodes and edges color and size. To familiarize yourself with SAMMI, we strongly suggest users refer to our </span><a href = "https://sammi.readthedocs.io/en/latest/videos.html"><span>video tutorials</span></a><span>.</span></div><div  class = 'S2'><span>In addition, users can temporarily or permanently remove nodes (ideal for secondary metabolites), isolate nodes, arrange nodes in specific shapes, export maps in a SAMMI specific format and PDF, and more. For a full list of interface functionalities, please refer to the </span><a href = "https://sammi.readthedocs.io/en/latest/index.html"><span>SAMMI documentation</span></a><span>. For examples of how to work with SAMMI please refer to the procedures section of this tutorial.</span></div><div  class = 'S2'><span>If you use SAMMI, please refer to the following publication:</span></div><ul  class = 'S3'><li  class = 'S4'><span>Schultz, A. &amp; Akbani, R. SAMMI: a semi-automated tool for the visualization of metabolic networks. </span><span style=' font-style: italic;'>Bioinformatics</span><span>. 36 (8), 2616–2617 (2020) </span></li></ul><h2  class = 'S1'><span>MATERIALS</span></h2><div  class = 'S2'><span>No materials needed.</span></div><h2  class = 'S1'><span>EQUIPMENT SETUP</span></h2><div  class = 'S2'><span>This SAMMI plugin requires MATLAB with a working COBRA toolbox installation, a system web-browser, and a working internet connection. If working on a remote server, X11 forwarding must be enabled or the relevant html file (index_load.html by default located in src/visualization/SAMMIM within your cobratoolbox folder) can be openned on your local machine in order to visualize the networks on a web browser. The latter can be done by mounting the remote folder on your local machine (e.g. sshfs) or by transfering the relevant files to your machine. If transferring the files you must also transfer all .js and .css files to the same folder.</span></div><div  class = 'S2'><span>SAMMI can also be run as a standalone tool on a web-browser through the SAMMI </span><a href = "https://bioinformatics.mdanderson.org/public-software/sammi/"><span>home page</span></a><span>. A </span><a href = "https://sammipy.readthedocs.io/en/latest/index.html"><span>python plugin</span></a><span> is also available for COBRApy.</span></div><h2  class = 'S1'><span>PROCEDURE</span></h2><div  class = 'S2'><span>This section includes some of the examples of how to work with the SAMMI MATLAB plugin. For the full plugin documentation and a full list of examples please refer to the </span><a href = "https://sammim.readthedocs.io/en/latest/index.html"><span>SAMMI MATLAB plugin documentation</span></a><span>. All of these examples are also available through the testSammi function.</span></div><div  class = 'S2'><span>For these examples, first make sure the COBRA toolbox is initiated. Since we will be working with models included with the toolbox, we will also retrieve the COBRA toolbox path:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Initialize toolbox</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >initCobraToolbox</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Get COBRA directory</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">global </span><span >CBTDIR;</span></span></div></div></div><div  class = 'S8'><span>To plot the entire model simply call the sammi function on the COBRA model. This is not advisable for medium to large models as the visualization may be too large to render.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Load model</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >load([CBTDIR </span><span style="color: rgb(170, 4, 249);">'/test/models/mat/ecoli_core_model.mat'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Plot</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sammi(model)</span></span></div></div></div><div  class = 'S8'><span>This should automatically open the following network on your web browser:</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "666.9" height = "460" alt = "test0.png" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>For larger models that can be too convoluted and too heavy to load in a single graph, users can define sub-graphs that can then be navigated using tools like the search and highlight functions. For this, simply pass the field you wish to use to partition the model as a second argument to the sammi function. This can be any reaction or metabolite field. The following example loads the Recon2 reconstruction (Thiele et. al.) divided into subsytems</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Load model</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >load([CBTDIR </span><span style="color: rgb(170, 4, 249);">'/test/models/mat/Recon2.v04.mat'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Plot a subgraph for each subsystem</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sammi(modelR204,</span><span style="color: rgb(170, 4, 249);">'subSystems'</span><span >)</span></span></div></div></div><div  class = 'S8'><span>This code will load the following map on your browser, where subfields can be navigated using the drop-down menu in the floating menu window:</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "666.9" height = "441" alt = "test1.png" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>To plot only user-defined reactions and their associated data, users can define a struct with which to parse the model into subsytems, and pass that struct as a second argument to th sammi function. The following example defines three subgraphs and generates random fluxes for each reaction.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Load model</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >load([CBTDIR </span><span style="color: rgb(170, 4, 249);">'/test/models/mat/ecoli_core_model.mat'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Get reactions to plot</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat = struct;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(1).name = </span><span style="color: rgb(170, 4, 249);">'TCA Cycle'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(1).rxns = {</span><span style="color: rgb(170, 4, 249);">'ACONTa'</span><span >;</span><span style="color: rgb(170, 4, 249);">'ACONTb'</span><span >;</span><span style="color: rgb(170, 4, 249);">'AKGDH'</span><span >;</span><span style="color: rgb(170, 4, 249);">'CS'</span><span >;</span><span style="color: rgb(170, 4, 249);">'FUM'</span><span >;</span><span style="color: rgb(170, 4, 249);">'ICDHyr'</span><span >;</span><span style="color: rgb(170, 4, 249);">'MDH'</span><span >;</span><span style="color: rgb(170, 4, 249);">'SUCOAS'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(2).name = </span><span style="color: rgb(170, 4, 249);">'Glycolysis'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(2).rxns = {</span><span style="color: rgb(170, 4, 249);">'ENO'</span><span >;</span><span style="color: rgb(170, 4, 249);">'FBA'</span><span >;</span><span style="color: rgb(170, 4, 249);">'FBP'</span><span >;</span><span style="color: rgb(170, 4, 249);">'GAPD'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PDH'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PFK'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PGI'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PGK'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PGM'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PPS'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PYK'</span><span >;</span><span style="color: rgb(170, 4, 249);">'TPI'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(3).name = </span><span style="color: rgb(170, 4, 249);">'Pentose Phosphate Pathway'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(3).rxns = {</span><span style="color: rgb(170, 4, 249);">'G6PDH2r'</span><span >;</span><span style="color: rgb(170, 4, 249);">'GND'</span><span >;</span><span style="color: rgb(170, 4, 249);">'PGL'</span><span >;</span><span style="color: rgb(170, 4, 249);">'RPE'</span><span >;</span><span style="color: rgb(170, 4, 249);">'RPI'</span><span >;</span><span style="color: rgb(170, 4, 249);">'TALA'</span><span >;</span><span style="color: rgb(170, 4, 249);">'TKT1'</span><span >;</span><span style="color: rgb(170, 4, 249);">'TKT2'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Add random flux</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:3; dat(i).flux = randn(length(dat(i).rxns),1); </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Plot only desired reactions</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sammi(model,dat);</span></span></div></div></div><div  class = 'S8'><span>The code above should yield the following graph:</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "761.3156250000001" height = "482" alt = "test7.png" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>To plot multiple sets of reaction and metabolite data as other than reaction color, users can save the desired data as a data table. This data table can then be saved into a struct and passed as a third argument to the sammi function. For instance, we can load five different sets of data (here random numbers) to the e_coli core model. The following code generated these data tables with a few NaNs:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Load model</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >load([CBTDIR </span><span style="color: rgb(170, 4, 249);">'/test/models/mat/ecoli_core_model.mat'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Define number of conditions</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >n = 5;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Make reaction table with random data</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >rxntbl = randn(length(model.rxns),n);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >rxntbl(randsample(length(model.rxns)*n,floor(n*length(model.rxns)/10))) = NaN;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >rxntbl = array2table(rxntbl,</span><span style="color: rgb(170, 4, 249);">'VariableNames'</span><span >,sprintfc(</span><span style="color: rgb(170, 4, 249);">'condition_%d'</span><span >,1:n),</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'RowNames'</span><span >,model.rxns);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Make metabolites table with random data</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >mettbl = randn(length(model.mets),n);</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >mettbl(randsample(length(model.mets)*n,floor(0.5*length(model.mets)))) = NaN;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >mettbl = array2table(mettbl,</span><span style="color: rgb(170, 4, 249);">'VariableNames'</span><span >,sprintfc(</span><span style="color: rgb(170, 4, 249);">'condition_%d'</span><span >,1:n),</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'RowNames'</span><span >,model.mets);</span></span></div></div></div><div  class = 'S8'><span>The reactions table, for instance, looks like the following:</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "677.98125" height = "290" alt = "testtable.png" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span>These tables can then be saved into a struct defining how the data should be mapped onto the network.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Make struct</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat = struct;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(1).type = {</span><span style="color: rgb(170, 4, 249);">'rxns' 'color'</span><span >}; </span><span style="color: rgb(2, 128, 9);">%Reaction nodes and edge color</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(1).data = rxntbl;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(2).type = {</span><span style="color: rgb(170, 4, 249);">'rxns' 'size'</span><span >};  </span><span style="color: rgb(2, 128, 9);">%Reaction nodes size</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(2).data = rxntbl;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(3).type = {</span><span style="color: rgb(170, 4, 249);">'mets' 'color'</span><span >}; </span><span style="color: rgb(2, 128, 9);">%Metabolite nodes color</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(3).data = mettbl;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(4).type = {</span><span style="color: rgb(170, 4, 249);">'mets' 'size'</span><span >};  </span><span style="color: rgb(2, 128, 9);">%Metabolite nodes size</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(4).data = mettbl;</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >dat(5).type = {</span><span style="color: rgb(170, 4, 249);">'links' 'size'</span><span >}; </span><span style="color: rgb(2, 128, 9);">%Edge thickness</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >dat(5).data = rxntbl;</span></span></div></div></div><div  class = 'S8'><span>In addition, in order to make the network less convoluted, we can shelve (temporarly remove) secondary metabolite nodes. Although this can de done through the floating menu using the "Shelve Metabolite" function (shortcut "s"), it can also be done programmatically for convenience. These metabolites can be re-introduced to the network using the "shelved metabolites" subsection of the floating window. To do so, define a list of regular expression strings into a cell array and pass that as the fourth argument to the sammi function. Any metabolite, matching any of these expressions will be shelved. For example:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Define secondaries</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >secondaries = {</span><span style="color: rgb(170, 4, 249);">'^h\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^h20\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^o2\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^co2\[.\]$'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'^atp\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^adp\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^pi\[.\]$'</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'^nadh\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^nadph\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^nad\[.\]$'</span><span >,</span><span style="color: rgb(170, 4, 249);">'^nadp\[.\]$'</span><span >};</span></span></div></div></div><div  class = 'S8'><span>Finally, plot the network and all the data:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%Plot dividing up by subsystems</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >sammi(model,</span><span style="color: rgb(170, 4, 249);">'subSystems'</span><span >,dat,secondaries)</span></span></div></div></div><div  class = 'S8'><span>The code above should yield the following network, where users can navigate subsystems as well as data conditions through the floating menu:</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "761.3156250000001" height = "482" alt = "test8.png" style = "vertical-align: baseline"></img></div><h2  class = 'S1'><span>TROUBLESHOOTING</span></h2><div  class = 'S2'><span>For questions and/or bug reports please submit issue requests either to the general </span><a href = "https://github.com/MD-Anderson-Bioinformatics/SAMMI"><span>SAMMI repository</span></a><span> or to the </span><a href = "https://github.com/schultzdre/SAMMIM"><span>MATLAB plugin repository</span></a><span>, or feel free to email Andre directly at the gmail schultzdre.</span></div><h2  class = 'S1'><span>TIMING</span></h2><div  class = 'S2'><span>SAMMI should not take more than a few seconds to load even the largest models, although relative speed should depend on your internet connection and map rendering varies with network size. If your map is taking a long time to render try dividing it into subgraphs.</span></div><h2  class = 'S1'><span>Acknowledgments</span></h2><div  class = 'S2'><span>The authors would like to thank our funding sources NIH/NCI and DOD. We would also like to thank Mary Rohrdanz and Chris Wakefield for their help implementing and maintaining SAMMI.</span></div><h2  class = 'S1'><span>REFERENCES</span></h2><ul  class = 'S3'><li  class = 'S4'><span>31, pages419–425 (2013)</span></li><li  class = 'S4'><span>Thiele et. al. A community-driven global reconstruction of human metabolism. </span><span style=' font-style: italic;'>Nat Biotech</span><span>. 31, 419–425 (2013)</span></li></ul><div  class = 'S2'></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% SAMMI Interactive Network Visualization Tool
%% Authors:
% Andre Schultz, Department of Bioinformatics and Computational Biology, UT 
% MD Anderson Cancer Center, Houston, Texas, USA
% 
% Rehan Akbani, Department of Bioinformatics and Computational Biology, UT MD 
% Anderson Cancer Center, Houston, Texas, USA
%% INTRODUCTION
% SAMMI loads COBRA models as force-directed, interactive networks on a web-browser. 
% Large networks can easily be partitioned into sub-networks which can then be 
% navigated using a series of provided functionality. Users can also load only 
% a subset of reactions and map data as nodes and edges color and size. To familiarize 
% yourself with SAMMI, we strongly suggest users refer to our <https://sammi.readthedocs.io/en/latest/videos.html 
% video tutorials>.
% 
% In addition, users can temporarily or permanently remove nodes (ideal for 
% secondary metabolites), isolate nodes, arrange nodes in specific shapes, export 
% maps in a SAMMI specific format and PDF, and more. For a full list of interface 
% functionalities, please refer to the <https://sammi.readthedocs.io/en/latest/index.html 
% SAMMI documentation>. For examples of how to work with SAMMI please refer to 
% the procedures section of this tutorial.
% 
% If you use SAMMI, please refer to the following publication:
%% 
% * Schultz, A. & Akbani, R. SAMMI: a semi-automated tool for the visualization 
% of metabolic networks. _Bioinformatics_. 36 (8), 2616–2617 (2020) 
%% MATERIALS
% No materials needed.
%% EQUIPMENT SETUP
% This SAMMI plugin requires MATLAB with a working COBRA toolbox installation, 
% a system web-browser, and a working internet connection. If working on a remote 
% server, X11 forwarding must be enabled or the relevant html file (index_load.html 
% by default located in src/visualization/SAMMIM within your cobratoolbox folder) 
% can be openned on your local machine in order to visualize the networks on a 
% web browser. The latter can be done by mounting the remote folder on your local 
% machine (e.g. sshfs) or by transfering the relevant files to your machine. If 
% transferring the files you must also transfer all .js and .css files to the 
% same folder.
% 
% SAMMI can also be run as a standalone tool on a web-browser through the SAMMI 
% <https://bioinformatics.mdanderson.org/public-software/sammi/ home page>. A 
% <https://sammipy.readthedocs.io/en/latest/index.html python plugin> is also 
% available for COBRApy.
%% PROCEDURE
% This section includes some of the examples of how to work with the SAMMI MATLAB 
% plugin. For the full plugin documentation and a full list of examples please 
% refer to the <https://sammim.readthedocs.io/en/latest/index.html SAMMI MATLAB 
% plugin documentation>. All of these examples are also available through the 
% testSammi function.
% 
% For these examples, first make sure the COBRA toolbox is initiated. Since 
% we will be working with models included with the toolbox, we will also retrieve 
% the COBRA toolbox path:

%Initialize toolbox
initCobraToolbox
%Get COBRA directory
global CBTDIR;
%% 
% To plot the entire model simply call the sammi function on the COBRA model. 
% This is not advisable for medium to large models as the visualization may be 
% too large to render.

%Load model
load([CBTDIR '/test/models/mat/ecoli_core_model.mat'])
%Plot
sammi(model)
%% 
% This should automatically open the following network on your web browser:
% 
% 
% 
% For larger models that can be too convoluted and too heavy to load in a single 
% graph, users can define sub-graphs that can then be navigated using tools like 
% the search and highlight functions. For this, simply pass the field you wish 
% to use to partition the model as a second argument to the sammi function. This 
% can be any reaction or metabolite field. The following example loads the Recon2 
% reconstruction (Thiele et. al.) divided into subsytems

%Load model
load([CBTDIR '/test/models/mat/Recon2.v04.mat'])
%Plot a subgraph for each subsystem
sammi(modelR204,'subSystems')
%% 
% This code will load the following map on your browser, where subfields can 
% be navigated using the drop-down menu in the floating menu window:
% 
% 
% 
% To plot only user-defined reactions and their associated data, users can define 
% a struct with which to parse the model into subsytems, and pass that struct 
% as a second argument to th sammi function. The following example defines three 
% subgraphs and generates random fluxes for each reaction.

%Load model
load([CBTDIR '/test/models/mat/ecoli_core_model.mat'])
%Get reactions to plot
dat = struct;
dat(1).name = 'TCA Cycle';
dat(1).rxns = {'ACONTa';'ACONTb';'AKGDH';'CS';'FUM';'ICDHyr';'MDH';'SUCOAS'};
dat(2).name = 'Glycolysis';
dat(2).rxns = {'ENO';'FBA';'FBP';'GAPD';'PDH';'PFK';'PGI';'PGK';'PGM';'PPS';'PYK';'TPI'};
dat(3).name = 'Pentose Phosphate Pathway';
dat(3).rxns = {'G6PDH2r';'GND';'PGL';'RPE';'RPI';'TALA';'TKT1';'TKT2'};
%Add random flux
for i = 1:3; dat(i).flux = randn(length(dat(i).rxns),1); end
%Plot only desired reactions
sammi(model,dat);
%% 
% The code above should yield the following graph:
% 
% 
% 
% To plot multiple sets of reaction and metabolite data as other than reaction 
% color, users can save the desired data as a data table. This data table can 
% then be saved into a struct and passed as a third argument to the sammi function. 
% For instance, we can load five different sets of data (here random numbers) 
% to the e_coli core model. The following code generated these data tables with 
% a few NaNs:

%Load model
load([CBTDIR '/test/models/mat/ecoli_core_model.mat'])
%Define number of conditions
n = 5;
%Make reaction table with random data
rxntbl = randn(length(model.rxns),n);
rxntbl(randsample(length(model.rxns)*n,floor(n*length(model.rxns)/10))) = NaN;
rxntbl = array2table(rxntbl,'VariableNames',sprintfc('condition_%d',1:n),...
    'RowNames',model.rxns);
%Make metabolites table with random data
mettbl = randn(length(model.mets),n);
mettbl(randsample(length(model.mets)*n,floor(0.5*length(model.mets)))) = NaN;
mettbl = array2table(mettbl,'VariableNames',sprintfc('condition_%d',1:n),...
    'RowNames',model.mets);
%% 
% The reactions table, for instance, looks like the following:
% 
% 
% 
% These tables can then be saved into a struct defining how the data should 
% be mapped onto the network.

%Make struct
dat = struct;
dat(1).type = {'rxns' 'color'}; %Reaction nodes and edge color
dat(1).data = rxntbl;
dat(2).type = {'rxns' 'size'};  %Reaction nodes size
dat(2).data = rxntbl;
dat(3).type = {'mets' 'color'}; %Metabolite nodes color
dat(3).data = mettbl;
dat(4).type = {'mets' 'size'};  %Metabolite nodes size
dat(4).data = mettbl;
dat(5).type = {'links' 'size'}; %Edge thickness
dat(5).data = rxntbl;
%% 
% In addition, in order to make the network less convoluted, we can shelve (temporarly 
% remove) secondary metabolite nodes. Although this can de done through the floating 
% menu using the "Shelve Metabolite" function (shortcut "s"), it can also be done 
% programmatically for convenience. These metabolites can be re-introduced to 
% the network using the "shelved metabolites" subsection of the floating window. 
% To do so, define a list of regular expression strings into a cell array and 
% pass that as the fourth argument to the sammi function. Any metabolite, matching 
% any of these expressions will be shelved. For example:

%Define secondaries
secondaries = {'^h\[.\]$','^h20\[.\]$','^o2\[.\]$','^co2\[.\]$',...
    '^atp\[.\]$','^adp\[.\]$','^pi\[.\]$',...
    '^nadh\[.\]$','^nadph\[.\]$','^nad\[.\]$','^nadp\[.\]$'};
%% 
% Finally, plot the network and all the data:

%Plot dividing up by subsystems
sammi(model,'subSystems',dat,secondaries)
%% 
% The code above should yield the following network, where users can navigate 
% subsystems as well as data conditions through the floating menu:
% 
% 
%% TROUBLESHOOTING
% For questions and/or bug reports please submit issue requests either to the 
% general <https://github.com/MD-Anderson-Bioinformatics/SAMMI SAMMI repository> 
% or to the <https://github.com/schultzdre/SAMMIM MATLAB plugin repository>, or 
% feel free to email Andre directly at the gmail schultzdre.
%% TIMING
% SAMMI should not take more than a few seconds to load even the largest models, 
% although relative speed should depend on your internet connection and map rendering 
% varies with network size. If your map is taking a long time to render try dividing 
% it into subgraphs.
%% Acknowledgments
% The authors would like to thank our funding sources NIH/NCI and DOD. We would 
% also like to thank Mary Rohrdanz and Chris Wakefield for their help implementing 
% and maintaining SAMMI.
%% REFERENCES
%% 
% * 31, pages419–425 (2013)
% * Thiele et. al. A community-driven global reconstruction of human metabolism. 
% _Nat Biotech_. 31, 419–425 (2013)
%% 
%
##### SOURCE END #####
-->
</div></body></html>